#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;

char tmp[105];
int aa[105],cc[105];
int b=13;

int main()
{
	memset(cc,0,sizeof(cc));
	cin>>tmp;
	int lena=strlen(tmp);
	for (int i=1;i<=lena;i++)
		aa[i]=tmp[i-1]-48;
	int x=0;
	for (int i=1;i<=lena;i++)
	{
		cc[i]=(x*10+aa[i])/b;
		x=(x*10+aa[i])%b;
	}
	int p=1;
	while (cc[p]==0&&p<lena) p++;
	
	for (int i=p;i<=lena;i++)
		cout<<cc[i];
	cout<<endl;
	cout<<x<<endl;
	
	return 0;
}